package com.sdcx.agrobank.ui.fragment;

import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.sdcx.agrobank.R;
import com.sdcx.agrobank.base.BaseFragment;
import com.stx.xhb.androidx.XBanner;

import java.util.ArrayList;

/**
 * Project   : haveyou
 * Package    : com.sdcx.agrobank.ui.fragment
 *
 * @author : Galaxy
 * @date : 2020/11/24 10:28
 * Desc      : TODO
 **/
public class lcFragment extends BaseFragment {

    private XBanner banner1,banner2;
    private ArrayList<Object> arr,arr1;

    @Override
    public void onLazyLoad() {

    }

    @Override
    protected int initLayout() {
        return R.layout.lcfragment;
    }

    @Override
    protected void init(View view) {
        banner1 = view.findViewById(R.id.banner);
        banner2 = view.findViewById(R.id.banner1);
        arr = new ArrayList<>();
        arr1 = new ArrayList<>();

        arr.add(R.mipmap.banner2);
        arr.add(R.mipmap.banner2);
        arr.add(R.mipmap.banner2);
        arr1.add(R.mipmap.banner3);
        arr1.add(R.mipmap.banner3);
        arr1.add(R.mipmap.banner3);
        banner1.setmAdapter(new XBanner.XBannerAdapter() {
            @Override
            public void loadBanner(XBanner banner, Object model, View view, int position) {
                //GlideUtil.display(getContext(),arr.get(position),(ImageView) view);
                Glide.with(getContext()).load(arr.get(position)).into((ImageView) view);
            }
        });
        banner1.setData(arr,null);

        banner2.setmAdapter(new XBanner.XBannerAdapter() {
            @Override
            public void loadBanner(XBanner banner, Object model, View view, int position) {
                //GlideUtil.display(getContext(),arr.get(position),(ImageView) view);
                Glide.with(getContext()).load(arr1.get(position)).into((ImageView) view);
            }
        });
        banner2.setData(arr1,null);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initLogic() {

    }

    @Override
    public void initImmersionBar() {

    }

    @Override
    public boolean immersionBarEnabled() {
        return false;
    }
}
